package android.video.online.ui.user;

import android.os.Message;
import android.video.online.R;
import android.video.online.ui.BasicActivity;
import android.video.online.utils.AppUtils;
import android.view.View;
import android.widget.TextView;

/**
 * Created by Jay on 2017/8/13.
 */

public class AboutActivity extends BasicActivity implements View.OnClickListener {

    private TextView mTvAppName;
    private TextView mTvCheckUpdate;
    private TextView mTvIntroduce;
    private TextView mTvVersion;

    @Override
    public int setLayoutId() {
        return R.layout.activity_about;
    }

    @Override
    public void init() {
        initView();
        initData();
        initListener();
    }

    private void initListener() {
        mTvCheckUpdate.setOnClickListener(this);
    }

    private void initData() {
        mTvAppName.setText(AppUtils.getAppName(getApplicationContext()));
        mTvIntroduce.setText(AppUtils.getAppName(getApplicationContext()));
        mTvVersion.setText("版本号： " + AppUtils.getAppVersion(getApplicationContext()));
    }

    private void initView() {
        mTvAppName = (TextView) findViewById(R.id.tv_appName);
        mTvCheckUpdate = (TextView) findViewById(R.id.tv_check_update);
        mTvIntroduce = (TextView) findViewById(R.id.tv_introduce);
        mTvVersion = (TextView) findViewById(R.id.tv_version);
    }

    @Override
    public void handlerMessage(Message msg) {

    }

    @Override
    public void onClick(View v) {
        showToast("已经是最新版本了");
    }
}
